<%@ page import="entity.Characters" %>
<%@ page import="java.util.List" %>
<%@ page import="entity.Operator" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        table{border: 1px solid gray;border-collapse: collapse;width: 100% }
        td{border: 1px solid gray;text-align: center;}
        a {color: #01040c; text-decoration:none;}
        a:visited {text-decoration:none;}
        a:hover {color:#ba2636;text-decoration:underline;}
        a:active {color:#ba2636;}
    </style>
    <%
        Operator operator = (Operator) request.getAttribute("operator");
        List<Characters> characters=(List<Characters>)request.getAttribute("characters");
    %>
</head>
<body>
<div>
    <form action="CharactersDistributionSaveServlet" method="post">
        <input type="text" style="display: none" name="operatorId" value="<%=operator.getOperatorID()%>">
        <select name="chs">
            <%for(int i = 0; i < characters.size(); i++){%>
                <option value="<%=characters.get(i).getCharacterID()%>"
                        <%if(characters.get(i).getCharacterID() == operator.getCharacter()){%> selected <%}%>>
                    <%=characters.get(i).getCharacterName()%>
                </option>
            <%}%>
        </select>
        <input type="submit"><br>
        <input type="button" onclick="window.location='CharactersDistributionServlet?page=1'" value="返回">
    </form>
</div>
</body>
</html>
